Title: All Tags
---
<div class="container-sm-height">
    <div class="row row-sm-height">
        <div class="col-sm-8 right-border col-sm-height">
            @Html.Partial("_PostList", Model.DocumentList(Keys.PageDocuments).OrderByDescending(x => x.Get<DateTime>(BlogKeys.Published)))

            <nav>
                <ul class="pager">
                    <li class="previous">                
                        @if(Model.Bool(Keys.HasPreviousPage))
                        {
                            <a href="@(Context.GetLink(Model.Document(Keys.PreviousPage)))"><span aria-hidden="true">&larr;</span> Newer</a>
                        }                
                    </li>
                    <li class="next">
                        @if(Model.Bool(Keys.HasNextPage))
                        {
                            <a href="@(Context.GetLink(Model.Document(Keys.NextPage)))">Older <span aria-hidden="true">&rarr;</span></a>
                        }
                    </li>
                </ul>
            </nav>
            <hr class="visible-xs-block" />
        </div>
		
        <div class="col-sm-4 col-sm-height">
            @foreach (IDocument tagDocument in Documents[Blog.Tags]
                .GroupBy(x => x.String(BlogKeys.Tag)).Select(x => x.Where(p => p.Get<int>(Keys.CurrentPage) == 1).First())
                .OrderByDescending(x => x.Get<int>(Keys.TotalItems)))
            {
                string tagName = tagDocument.String(BlogKeys.Tag);
                string postCount = tagDocument.String(Keys.TotalItems);
                string buttonStyle = tagName == Model.String(BlogKeys.Tag) ? "btn-primary" : "btn-default";
                <a role="button" href="@Context.GetLink(tagDocument)" class="btn @buttonStyle btn-xs">@tagName (@postCount)</a>
            }
        </div>
    </div>
</div>